//
// Created by 11510 on 2024/6/25.
//
#include <iostream>
#include <list>
#include <set>
#include <vector>
using namespace std;

std::ostream &operator<<(std::ostream &ostr, const std::set<int> &list) {
    for (auto &i: list) {
        ostr << " " << i;
    }
    return ostr;
}

void test1() {
//    set<int, greater<int>> number = {1, 4, 5, 2, -2, 0};
    set<int> number = {1, 4, 5, 2, -2, 0};

    size_t cnt = number.count(9);
    set<int>::iterator it = number.find(3);
    if(it == number.end()){
        cout << "not find" << endl;
    }

    pair<set<int>::iterator, bool> ret = number.insert(91);
    if(ret.second){
        cout << "insert success!" << endl;
    }

    vector<int> vec = {3, 2, 5, 8};
    number.insert(vec.begin(), vec.end());
    /**
     * set 不支持下标，不支持迭代器修改元素
     */

    cout << number;
}

int main() {
    test1();
    return 0;
}